package sky.service.Impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import sky.dao.AirportDAO;
import sky.domain.Airport;
import sky.service.AirportService;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Gauss
 * Date: 23.04.13
 * Time: 10:33
 * To change this template use File | Settings | File Templates.
 */
@Service
public class AirportServiceImpl implements AirportService{

    @Autowired
    private AirportDAO airportDAO;

    @Override
    @Transactional
    public void addAirport(Airport airport) {
        airportDAO.addAirport(airport);
    }

    @Override
    @Transactional
    public List<Airport> listAirport() {
        return airportDAO.listAirport();
    }

    @Override
    @Transactional
    public void editAirport(Airport airport) {
        airportDAO.editAirport(airport);
    }

    @Override
    @Transactional
    public Airport getAirportByName(String name) {
        return airportDAO.getAirportByName(name);
    }

    @Override
    @Transactional
    public Airport getAirportById(Integer id) {
        return airportDAO.getAirportById(id);
    }

    @Override
    @Transactional
    public void removeAirport(Integer id) {
        airportDAO.removeAirport(id);
    }
}
